package Operation;

import Book.Book;
import Book.BookList;

import java.util.Scanner;
public class Add implements IOperation {

	    public void work(BookList bookList) {
	        System.out.println("新增图书!");
	        Scanner scan=new Scanner(System.in);
	        System.out.println("请输入要新增图书的编号:");
	        String ISBN=scan.next();
	        System.out.println("请输入要新增图书的名字:");
	        String bookname=scan.next();
	        System.out.println("请输入作者的名字:");
	        String author=scan.next();
	        System.out.println("请输入要新增图书的出版社的名字:");
	        String publisher=scan.next();
	        System.out.println("请输入图书的价格:");
	        double price=scan.nextDouble();
	        Book book=new Book(ISBN,bookname,author,publisher,price);
	        bookList.getBooks().add(book); //使用ArrayList的add来进行图书的添加
	        System.out.println("添加成功!");
	    }
}